<template>
  <div class="page">
    <!-- 表单 -->

    <a-card>
      <com-vxe-table
        :columns="columns"
        :axios="page"
        :fromItem="fromItem"
        :formData="formData"
        :initialize="initialize"
        @check-view="checkView"
        ref="xTable"
      >
        <template #operate="data">
          <div>
            <vxe-button
              title="查看"
              status="primary"
              content="查看"
              @click="data.callback(data.row)"
            ></vxe-button>
          </div>
        </template>
      </com-vxe-table>
    </a-card>
    <year-model
      ref="model"
      :refs="$refs"
      :toSubmit="true"
      @refresh="$refs.xTable.getQueryList()"
      :back="false"
    >
      <template #default="data">
        <tas-component
          :active="active"
          :panes="panes"
          :panesIndex="1"
          @active="tabsCallback"
        >
          <template>
            <ypscForm
              :params="data.ndkp"
              :disabled="true"
              :nextNodeDbrList="data.nextNodeDbrList"
              :nextNode="data.nextNode"
              ref="form"
              v-show="active == '1'"
            ></ypscForm>
            <YregisteredView
              :params="data.ndkp"
              v-show="active == '2'"
            ></YregisteredView>
          </template>
        </tas-component>
      </template>
      <template #footer>
        <template>
          <div></div>
        </template>
      </template>
    </year-model>
  </div>
</template>

<script>
//已完成
import { openMyNdkpJbxx, flowJobPage } from "../../api/yearCheck";
import comVxeTable from "@/views/everydayCheck/components/vxe-table/com-vxe-table";
import YearModel from "../../components/yearCheck/year-model.vue";
import ypscForm from "@/views/everydayCheck/yearCheck/prview/ypscForm";
import TasComponent from "../prview/tas-component.vue";
import YregisteredView from "../prview/YregisteredView.vue";
import { panes } from "../../common/GroupConfig";
export default {
  components: {
    comVxeTable,
    YearModel,
    ypscForm,
    TasComponent,
    YregisteredView,
  },
  name: "dengjiPage",
  props: {
    fywflcode: {
      type: String,
      default: "",
    },
    fhjmc:{
      type:String,
      default:''
    }
  },
  data() {
    return {
      columns: [
        {
          type: "checkbox",
        },
        {
          type: "seq",
          title: "序号",
          width: "60",
        },
        {
          field: "fusermc",
          title: "用户名称",
          width: "150",
        },
        {
          field: "fgzdw",
          title: "工作单位",
          width: "150",
        },
        {
          field: "fyear",
          title: "年度",
          width: "150",
        },
        {
          field: "fzjkssj",
          title: "总结开始时间",
          width: "150",
        },
        {
          field: "fzjjssj",
          title: "总结结束时间",
          width: "150",
        },
        {
          field: "ffsrmc",
          title: "发送人",
          width: "150",
        },

        {
          title: "操作",
          field: "operate",
          width: 200,
          slots: { default: "operate", fixed: "right" },
          fixed: "right"
        },
      ],
      queryParams: {},
      config: {},
      data: [],
      allAlign: null,
      formData: {
        fsxmc: "",
        fqymc: "",
        fslsj: "",
        fjzrq: "",
      },
      fromItem: [
        {
          field: "fyear",
          title: "年度",
          type:'input',
          itemRender: {},
          slots: { default: "name_item" },
        },
        {
          field: "fzjjssj",
          title: "总结开始时间",
          itemRender: {},
          type:'datetime',
          slots: { default: "name_item" },
        },
        {
          field: "fzjkssj",
          title: "总结结束时间",
          type:'datetime',
          itemRender: {},
          slots: { default: "name_item" },
        },
      ],
      page: flowJobPage,
      initialize: {
        fhjmc: this.fhjmc,
        fblzt: "待办",
        sfcxgr:'否',
      },
      form: {},
      model: {},
      // 选项卡
      active: "1",
      panes: panes,
      timeout: null,
    };
  },
  created() {
    
  },
  mounted() {},

  methods: {
    // 编辑
    checkView(row) {
      //console.log(row);
      this.$refs.model.handler(row, { jobid: row.jobid });
    },
    // 选项卡
    tabsCallback(action) {
      this.active = action;
    },
  },
};
</script>

<style lang="less" scoped>
// @import "../assets/table.less";
@import url("../../assets/table.less");
</style>
